﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// dbUtils 的摘要说明
/// </summary>
public static class DbUtils
{
    //string conn = "Data Source=127.0.0.1;User ID=root;Password=x5;DataBase=test";
    private static string conn = "Server = 47.93.40.90; UserId = root; Password = x5; Database = asp; pooling = false; CharSet = utf8; port = 3306";
   
    public static MySqlConnection getCon()
    {
        string conn = "Server = 47.93.40.90; UserId = root; Password = x5; Database = asp; pooling = false; CharSet = utf8; port = 3306";
        MySqlConnection con = new MySqlConnection(conn);
        con.Open();
        return con;
    }

    public static void close(MySqlConnection con)
    {
        con.Close();
    }

    public static void close(MySqlConnection con, MySqlDataReader reader)
    {
        reader.Close();
        con.Close();
    }
}